/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mapping;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Andres
 */
@Entity
@Table(name = "detalles_red")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetallesRed.findAll", query = "SELECT d FROM DetallesRed d"),
    @NamedQuery(name = "DetallesRed.findByIdDetalleRed", query = "SELECT d FROM DetallesRed d WHERE d.idDetalleRed = :idDetalleRed"),
    @NamedQuery(name = "DetallesRed.findByIp", query = "SELECT d FROM DetallesRed d WHERE d.ip = :ip"),
    @NamedQuery(name = "DetallesRed.findByMac", query = "SELECT d FROM DetallesRed d WHERE d.mac = :mac")})
public class DetallesRed implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idDetalleRed")
    private Integer idDetalleRed;
    @Column(name = "ip")
    private String ip;
    @Column(name = "mac")
    private String mac;
    @JoinColumn(name = "idRed", referencedColumnName = "idRed")
    @ManyToOne
    private Red idRed;
    @JoinColumn(name = "idDisp", referencedColumnName = "idDisp")
    @ManyToOne(optional = false)
    private Dispositivo idDisp;

    public DetallesRed() {
    }

    public DetallesRed(Integer idDetalleRed) {
        this.idDetalleRed = idDetalleRed;
    }

    public Integer getIdDetalleRed() {
        return idDetalleRed;
    }

    public void setIdDetalleRed(Integer idDetalleRed) {
        this.idDetalleRed = idDetalleRed;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public Red getIdRed() {
        return idRed;
    }

    public void setIdRed(Red idRed) {
        this.idRed = idRed;
    }

    public Dispositivo getIdDisp() {
        return idDisp;
    }

    public void setIdDisp(Dispositivo idDisp) {
        this.idDisp = idDisp;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleRed != null ? idDetalleRed.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetallesRed)) {
            return false;
        }
        DetallesRed other = (DetallesRed) object;
        if ((this.idDetalleRed == null && other.idDetalleRed != null) || (this.idDetalleRed != null && !this.idDetalleRed.equals(other.idDetalleRed))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.mapping.DetallesRed[ idDetalleRed=" + idDetalleRed + " ]";
    }
    
}
